<!DOCTYPE HTML>
<html>
<head>
<title>Absolution OTA</title>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

<script type="text/javascript" charset="utf-8" src="phonegap-1.4.1.js"></script>
<style type="text/css">
body 

{
background-image:url('DarkBlueGray.jpg');
}
a:active {color:white; text-decoration: none; }
a:visited {color:white; text-decoration: none; }
body {color:white; text-decoration: none; }

</style>



<script>
function RemoveWhitespace(xml)
{
	var loopIndex;
	for (loopIndex = 0; loopIndex < xml.childNodes.length; loopIndex++)
	{
		var currentNode = xml.childNodes[loopIndex];
		if (currentNode.nodeType == 1){RemoveWhitespace(currentNode);}
		if (((/^\s+$/.test(currentNode.nodeValue))) && (currentNode.nodeType == 3))
		{
			xml.removeChild(xml.childNodes[loopIndex--]);
		}
	}
}

function getFileName(url) {
	//this removes the anchor at the end, if there is one
	url = url.substring(0, (url.indexOf("#") == -1) ? url.length : url.indexOf("#"));
	//this removes the query after the file name, if there is one
	url = url.substring(0, (url.indexOf("?") == -1) ? url.length : url.indexOf("?"));
	//this removes everything before the last slash in the path
	url = url.substring(url.lastIndexOf("/") + 1, url.length);
	//return
	return url;

}

function GetParam(name)
{
  var start=location.search.indexOf("?"+name+"=");
  if (start<0) start=location.search.indexOf("&"+name+"=");
  if (start<0) return '';
  start += name.length+2;
  var end=location.search.indexOf("&",start)-1;
  if (end<0) end=location.search.length;
  var result='';
  for(var i=start;i<=end;i++) {
    var c=location.search.charAt(i);
    result=result+(c=='+'?' ':c);
  }
  return unescape(result);
}
</script>

</head>



<body>

    <div>
    <table border=0 width="100%"><tr></td><td align="center" width="*">
    <img src="Absologo.png" width="200">
    </td></td></tr></table>
    </div>
    <P>
	<DIV style="font-size:12px;">
	
		<script>
		
		var oRequest = new XMLHttpRequest();
		var elementArray=null;
		var THEMENAME = 0;
		var AUTHOR = 1;
		var LOCATION = 2;
		var IMAGE = 3;
		var VERSION = 4;
		
        var isArchive = GetParam('isArchive');
        //document.write('havVersion= '+isArchive+'<Br>');
		
       if (isArchive==1)
    	   {
    	   		var sURL  = "http://rootdev.org/Ascension/OTA/themes_archive.xml";
    	   }
       else
    	   {
				var sURL  = "http://rootdev.org/Ascension/OTA/themes.xml"; 
    	   }
		
		oRequest.open("GET",sURL,false);
		oRequest.setRequestHeader("Content-Type", "text/xml");
		oRequest.setRequestHeader("Cache-Control","no-cache");
		oRequest.send(null);
		
		var xmlDoc = oRequest.responseXML;
		
		// have to remove whitespace due to browser
		RemoveWhitespace(xmlDoc);
		
		// first get the theme files
		elementArray = xmlDoc.getElementsByTagName('theme');
		
		 if (isArchive==1)
  	   		{
				document.write('<font color="#fa9600"><H3>THEMES ARCHIVE</H3></font>');
  	   		}else{
  	   			document.write('<font color="#fa9600"><H3>THEMES</H3></font>');
  	   		}
		document.write('<font size=2>Click image to view larger size </br> Click download, then flash with recovery </font><hr>');
		
		for (i = 0; i < elementArray.length ; i++)
		{
			document.write("<table border=0 width=\"100%\"><tr><td>");
			if (elementArray[i].childNodes[THEMENAME].hasChildNodes())
			   	document.write('Name : ' + elementArray[i].childNodes[THEMENAME].childNodes[0].nodeValue + '<br>');
			if (elementArray[i].childNodes[AUTHOR].hasChildNodes())
			   	document.write('Created By : ' + elementArray[i].childNodes[AUTHOR].childNodes[0].nodeValue + '<br>');
			if (elementArray[i].childNodes[LOCATION].hasChildNodes())
				document.write('<a href=\"' + elementArray[i].childNodes[LOCATION].childNodes[0].nodeValue + '\">Download</a><br>');
			if (elementArray[i].childNodes[VERSION].hasChildNodes())
			   	document.write('Absolution Version : ' + elementArray[i].childNodes[VERSION].childNodes[0].nodeValue + '<br>');
			document.write("</td><td width=\"30%\" align=\"center\">");
			if (elementArray[i].childNodes[IMAGE].hasChildNodes()){
				document.write('<a href=\"'+elementArray[i].childNodes[IMAGE].childNodes[0].nodeValue+'\">');
				document.write('<img src=\"' + elementArray[i].childNodes[IMAGE].childNodes[0].nodeValue + '\" height=100>');
				document.write("</a>");
			}
			document.write("</td></tr></table>");
			document.write("<hr><br>"); 
		}
		
		</script>
    
    </DIV>
<center><img src="Absologo.png" width="200"></center>    

</body>
</html>
